package com.livesource.client.web.sourceCode.edit;

import com.google.gwt.user.client.ui.ListBox;
import com.livesource.client.model.entry.ProjectClass;
import com.livesource.client.utilities.FeatureNameGenerator;

/**
 * 
 * @UserManual
 */
public class ClassTypeList extends ListBox {

	public ClassTypeList(String classType) {

		this.setWidth("100px");

		this.addItem("");

		this.addItem(
				FeatureNameGenerator.spacedName(ProjectClass.ARCHITECTURE_TYPE),
				ProjectClass.ARCHITECTURE_TYPE);

		this.addItem(FeatureNameGenerator.spacedName(ProjectClass.ENTITY_TYPE),
				ProjectClass.ENTITY_TYPE);

		this.addItem(
				FeatureNameGenerator.spacedName(ProjectClass.FEATURE_TYPE),
				ProjectClass.FEATURE_TYPE);

		this.addItem(FeatureNameGenerator
				.spacedName(ProjectClass.USER_INTERFACE_TYPE),
				ProjectClass.USER_INTERFACE_TYPE);

		if (ProjectClass.ARCHITECTURE_TYPE.equals(classType)) {

			this.setSelectedIndex(1);

		} else if (ProjectClass.ENTITY_TYPE.equals(classType)) {

			this.setSelectedIndex(2);

		} else if (ProjectClass.FEATURE_TYPE.equals(classType)) {

			this.setSelectedIndex(3);

		} else if (ProjectClass.USER_INTERFACE_TYPE.equals(classType)) {

			this.setSelectedIndex(4);
		}
	}
}
